<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Backup extends MY_Controller {

	public $data 	= 	array();
 	public $_template = array();
	public function __construct() {

		parent::__construct(); //for CI 2.x users 
		$this->load->module_model('member', 'qlsv_model', 'hocky');
		$this->load->module_language('member', 'qlsv');
		$this->load->helper('text');
		$this->user = $this->access->get_user();
		$this->load->helper('url');
		$this->access->restrict();
		
		$this->load->dbutil();
		$this->load->helper('download');
	}
	
 
	public function index() 
	{
		$data['ItemID'] = 'User';
		$data['title'] = 'Backup and Restore';
		$data['description'] = 'Backup and Restore';
		
		$backup =& $this->dbutil->backup(); 
		$file_name = 'database-' . date('Y-m-d') . '.sql.gz';
		
		force_download($file_name, $backup); 
		
	
	}
	
	
	
}

/* End of file welcome.php */
/* Location: ./application/controllers/products.php */